changed behaviour to raise error instead of using default db when re… #157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thoas has the following behaviour such that when a release version is requested via the genome uuid, one of the following happens:
The diagram below shows a clearer view of this issue
sequenceDiagram title GraphQL Core Generic Workflow actor User as User participant GraphQL_BE as GraphQL UI/Backend participant gRPC as gRPC Service participant Metadata_DB as Metadata Database participant Mongo_DB as Mongo Database User ->> GraphQL_BE: Sends Query Request GraphQL_BE ->> gRPC: Request Release Version using Genome UUID gRPC ->> Metadata_DB: Fetch Release Version Note over gRPC, Metadata_DB: Example version: 110.3 alt gRPC Connection Success opt Release Found in Metadata DB Metadata_DB -->> gRPC: Release Found gRPC -->> GraphQL_BE: Return Release Version GraphQL_BE ->> Mongo_DB: Fetch data from Mongo Note over GraphQL_BE, Mongo_DB: e.g., 'release_110_3' Mongo DB Mongo_DB -->> User: Return Fetched Data end opt Release NOT Found in Metadata DB Metadata_DB -->> gRPC: Release NOT Found gRPC -->> GraphQL_BE: Notify Release Not Found GraphQL_BE -->> GraphQL_BE: Fallback to "default_mongo_db" Note over GraphQL_BE: Default Mongo DB used as fallback GraphQL_BE ->> Mongo_DB: Fetch data from default Mongo (e.g., 'release_110_1') Mongo_DB -->> User: Return Fallback Data end else gRPC Connection FAILED gRPC -->> GraphQL_BE: Connection Failed GraphQL_BE -->> GraphQL_BE: Fallback to "default_mongo_db" Note over GraphQL_BE: Using default Mongo DB due to gRPC failure GraphQL_BE ->> Mongo_DB: Fetch data from default Mongo (e.g., 'release_110_1') Mongo_DB -->> User: Return Fallback Data endThis PR adds a fix such that if a release is not found or gRPC connection is unreachable, it returns an error to the user rather than using a default db.